package com.h3c.dal.dao.impl;

import com.h3c.dal.dao.CasssoRoleResourceRelationDAO;
import com.h3c.dal.dao.SqlMapClientDaoSupport;
import com.h3c.dal.entity.CasssoRoleResourceRelationDO;
import com.h3c.dal.entity.query.CasssoRoleResourceRelationQuery;
import com.ibatis.sqlmap.client.SqlMapClient;
import java.sql.SQLException;
import java.util.List;

public class CasssoRoleResourceRelationDAOImpl  extends SqlMapClientDaoSupport  implements CasssoRoleResourceRelationDAO {

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public void insert(CasssoRoleResourceRelationDO record) throws SQLException {
        sqlMapClient.insert("cassso_role_resource_relation.abatorgenerated_insert", record);
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int updateByPrimaryKey(CasssoRoleResourceRelationDO record) throws SQLException {
        int rows = sqlMapClient.update("cassso_role_resource_relation.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int updateByPrimaryKeySelective(CasssoRoleResourceRelationDO record) throws SQLException {
        int rows = sqlMapClient.update("cassso_role_resource_relation.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public List selectByExample(CasssoRoleResourceRelationQuery example) throws SQLException {
        List list = sqlMapClient.queryForList("cassso_role_resource_relation.abatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public CasssoRoleResourceRelationDO selectByPrimaryKey(String rrId) throws SQLException {
        CasssoRoleResourceRelationDO key = new CasssoRoleResourceRelationDO();
        key.setRrId(rrId);
        CasssoRoleResourceRelationDO record = (CasssoRoleResourceRelationDO) sqlMapClient.queryForObject("cassso_role_resource_relation.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int deleteByExample(CasssoRoleResourceRelationQuery example) throws SQLException {
        int rows = sqlMapClient.delete("cassso_role_resource_relation.abatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int deleteByPrimaryKey(String rrId) throws SQLException {
        CasssoRoleResourceRelationDO key = new CasssoRoleResourceRelationDO();
        key.setRrId(rrId);
        int rows = sqlMapClient.delete("cassso_role_resource_relation.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int countByExample(CasssoRoleResourceRelationQuery example) throws SQLException {
        Integer count = (Integer)  sqlMapClient.queryForObject("cassso_role_resource_relation.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int updateByExampleSelective(CasssoRoleResourceRelationDO record, CasssoRoleResourceRelationQuery example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = sqlMapClient.update("cassso_role_resource_relation.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    public int updateByExample(CasssoRoleResourceRelationDO record, CasssoRoleResourceRelationQuery example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = sqlMapClient.update("cassso_role_resource_relation.abatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This class was generated by Abator for iBATIS.
     * This class corresponds to the database table cassso_role_resource_relation
     *
     * @abatorgenerated Tue May 09 18:54:23 CST 2017
     */
    private static class UpdateByExampleParms extends CasssoRoleResourceRelationQuery {
        private Object record;

        public UpdateByExampleParms(Object record, CasssoRoleResourceRelationQuery example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}